package snippet;

import java.util.ArrayList;
import java.util.List;

public class T728 {

	public static void main(String[] args) {
		System.out.println(new T728().selfDividingNumbers(1, 22));

	}

	public List<Integer> selfDividingNumbers(int left, int right) {
		List<Integer> list = new ArrayList<>();
		for (int i = left; i <= right; i++) {
			boolean f = true;
			int t = i;
			while (t > 0) {
				int p = t % 10;
				t = t / 10;
				if (p == 0 || i % p != 0) {
					f = false;
					break;
				}
			}
			if (f) {
				list.add(i);
			}
		}
		return list;

	}
}
